package gae.google.tcserver.db;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * The <tt>Activity</tt> class defines the database table that
 * holds information about calendar activities 
 *
 * @author Lars Friberg
 *
 * @date 2011-02-04
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Activity implements Serializable {

	/**
	 * Serial version Id
	 */
	private static final long serialVersionUID = 1L;

	@PrimaryKey
	@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
	private Key keyId;				 	 // this is the primary key Id
	
	@Persistent
	private Date date;				     // this is the date of the activity

	@Persistent
	private String activity;			 // this is the activity
	
	/**
	 * get primary key Id
	 * 
	 * @return keyId the primary key id
	 */
	public Key getKeyId() {
		return keyId;
	}

	/**
	 * get date
	 * 
	 * @return date the date of the activity
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * get activity
	 * 
	 * @return activity the activity
	 */
	public String getActivity() {
		return activity;
	}
	
	/**
	 * Constructor
	 */
	public Activity() {
		super();
	}

	/**
	 * constructor, initiate parameters
	 * 
	 * @param date the date
	 * @param activity the activity
	 */
	public Activity(Date date, String activity) {
		super();
		this.date = date;
		this.activity = activity;
	}
}